<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
%>
<!doctype html>
<html>
<head>
	<meta charset="UTF-8">
    <meta name="copyright" content="Tencent"/>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="author" content="social-touch.com"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
	<title>药品说明</title>
	<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/demo/public.css" />
	<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/demo/base.css" />
	<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/demo/style.css" />
</head>
<body>
	
	
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/bootcdn/BootCDN/ajax/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
	<script src="<%=path%>/hplus/js/plugins/suggest/bootstrap-suggest.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
    <script src="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/artDialog/7.0.0/dialog-plus.js"></script>
	<script type="text/javascript" src="<%=path%>/js/marketing/public.js"></script>
	<script src="<%=path%>/hplus/js/plugins/iCheck/icheck.min.js"></script>
	<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>	
	<script type="text/javascript">
		var path = "<%=path%>";
		var id=getQueryString("orderId");
		var cid=getQueryString('cid');
		var cid=getQueryString('cid');
	   //	var ruleId=getQueryString("ruleId");
	   	var ip=returnCitySN["cip"]+','+returnCitySN["cname"];
	   	var medicineId=getQueryString("medicineId");
		var clickUrl=path+"/ser/evaluate/click";
		var option="";		
	   	//var uid=$.cookie('uid');   	
		$(function(){
			 dataInit();
			//console.log("------->ruleId"+ruleId);
			$.post(clickUrl,{"cid" : cid,
        		"order_id":id,"browse_ip":ip});
		});
		 function dataInit(){
			//console.log(id);
			<%-- var orderUrl="<%=path%>/ser/order/findOrder";		
			$.post(orderUrl,{"cid":cid,"id":id},
			function(data){
				//console.log("-------->订单信息"+data);
				data=JSON.parse(data);
				//console.log("-------->订单信息"+data);
				var json=JSON.parse(data.goods_name);
				//console.log("-------->药品信息"+data.goods_name);
				for(var i=0;i<json.length;i++){
					getData(json[i].goodsId);
				}		
				$("body").html(option);
			}
			); --%>
			getData(medicineId);
			$("body").html(option);
		}
		function getData(id){
			console.log(id);
			var medicineUrl="<%=path%>/api/drugScan/getGoodsByGoodsNumber";
			var medicineData;
				$.ajax({
					url:medicineUrl,
					type:"post",
					async:false,
					data:{"tenantId" : cid,"goodsNumber":id},
					success:function(data){		
						if(data.status == 200){
							medicineData=data.data;	
						}															
					}
				});
			setHtml(medicineData);
		}
		
		function setHtml(medicineData){
			//console.log("------------>药品信息"+medicineData);			
			option+="<p class='s_title'>";
			option+=StringReplace(medicineData.medicineName)+"药品说明</p>";
			option+="<dl class='s_content'>";
			option+="<dt>【药品名称】</dt>";
			option+="<dd>"+StringReplace(medicineData.medicineName)+"</dd></dl>";
			option+="<dl class='s_content'>";
			option+="<dt>【药品单位】</dt>";
			option+="<dd>"+StringReplace(medicineData.specifications)+"</dd></dl>";	
			option+="<dl class='s_content'>";
			option+="<dt>【药品成分】</dt>";
			option+="<dd>"+StringReplace(medicineData.component)+"</dd></dl>";
			option+="<dl class='s_content'>";
			option+="<dt>【适应症状】</dt>";
			option+="<dd>"+StringReplace(medicineData.indication)+"</dd></dl>";
			option+="<dl class='s_content'>";
			option+="<dt>【用法用量】</dt>";
			option+="<dd>"+StringReplace(medicineData.dosage)+"</dd></dl>";
			option+="<dl class='s_content'>";
			option+="<dt>【不良反应】</dt>";
			option+="<dd>"+StringReplace(medicineData.sideEffect)+"</dd></dl>";	
			option+="<dl class='s_content'>";
			option+="<dt>【药品禁忌】</dt>";
			option+="<dd>"+StringReplace(medicineData.contraindication)+"</dd></dl>";
			option+="<dl class='s_content'>";
			option+="<dt>【注意事项】</dt>";
			option+="<dd>"+StringReplace(medicineData.precaution)+"</dd></dl>";
			option+="<dl class='s_content'>";
			option+="<dt>【药品贮藏】</dt>";
			option+="<dd>"+StringReplace(medicineData.storage)+"</dd></dl>";
			option+="<dl class='s_content'>";
			option+="<dt>【有效期】</dt>";
			option+="<dd>"+StringReplace(medicineData.periodValid)+"</dd></dl>";
			option+="<dl class='s_content'>";
			option+="<dt>【批准文号】</dt>";
			option+="<dd>"+StringReplace(medicineData.numberApproval)+"</dd></dl>";
			option+="<dl class='s_content'>";
			option+="<dt>【生产企业】</dt>";
			option+="<dd>"+StringReplace(medicineData.companyName)+"</dd></dl>";			
		}
		function StringReplace(content){
			if(StringEmpty(content)){
				return content;
			}else{
				return "暂无";
			}
		};
		//判断字符串是否为空
		function StringEmpty(content) {
			if (content == undefined || content == "" || content == null) {
				return false;
			} else {
				return true;
			}
		}
	</script>	
</html>